<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <input type="file" >
  </body>
  <script type="text/javascript">
      input = document.querySelector("input[type=file]");
      input.addEventListener("change",function(event){
        const file = input.files[0];
        const fr = new FileReader();
        fr.onload = function(){
          const img = new Image();
          img.src = fr.result;
          document.body.appendChild(img);
        }
        fr.readAsDataURL(file);
      });
  </script>
</html>
